package com.luhuiguo.cms.shared.event;

import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.user.client.ui.TreeItem;
import com.luhuiguo.cms.shared.model.ChannelModel;

public class ChannelUpdatedEvent extends GwtEvent<ChannelUpdatedEventHandler> {

    public static Type<ChannelUpdatedEventHandler> TYPE = new Type<ChannelUpdatedEventHandler>();

    private final TreeItem treeItem;

    private final ChannelModel channelModel;

    public ChannelUpdatedEvent(ChannelModel channelModel, TreeItem treeItem) {
        this.channelModel = channelModel;
        this.treeItem = treeItem;

    }

    public ChannelModel getChannel() {
        return channelModel;
    }

    public TreeItem getTreeItem() {
        return treeItem;
    }


    @Override
    public Type<ChannelUpdatedEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(ChannelUpdatedEventHandler handler) {
        handler.onChannelUpdated(this);
    }
}
